﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExpenseTracker.Entity;
using ExpenseTracker.DataAccess;

namespace ExpenseTracker.Controller
{
    public class ExpenseController : BaseController
    {
        private ExpenseDb _database = null;

        public ExpenseController(ExpenseTracker.Entity.Account account)
            : base(account)
        {
            _database = new ExpenseDb(account);
        }

        public void CreateTable()
        {
            _database.CreateTable();
        }

        public void InsertExpense(ExpenseTracker.Entity.Expense expense)
        {
            _database.InsertExpense(expense);
        }

        public void UpdateExpense(ExpenseTracker.Entity.Expense expense)
        {
            _database.UpdateExpense(expense);
        }

        public List<Expense> GetExpenses()
        {
            return _database.GetExpenses();
        }

        public List<Expense> GetExpenses(List<QueryMonth> months, List<Category> categories, bool excludeDisabled)
        {
            return _database.GetExpenses(months, categories, excludeDisabled);
        }

        public Expense GetExpense(int expenseID)
        {
            return _database.GetExpense(expenseID);
        }

        public void DeleteExpense(int expenseID)
        {
            _database.DeleteExpense(expenseID);
        }
    }
}
